#!/bin/zsh
if [ "$(id -u)" != "0" ]; then
    sudo zsh $0 $@
    exit $?
fi

. /opt/shellscripts/functions.sh all

if IsCommandExists lnmp && [ "$1" != "-f" ]; then
    echo "lnmp installed.."
    exit 0
fi

if ! IsDir lnmp1.5; then
    git clone https://github.com/xiaosumay/lnmp.git lnmp1.5
    cd lnmp1.5 && chmod +x *.sh && rm -rf .git && cd ..
fi

cd lnmp1.5 && LNMP_Auto="y" DBSelect="3" DB_Root_Password="root" InstallInnodb="y" PHPSelect="8" SelectMalloc="1" ./install.sh lnmp